package cn.edu.scau.cmi.lixiaoyuan.composite.consistent;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Team extends ConsistentOrganization{
	
	
    public Team(String name) {
		super();
		this.name = name;
	}

	public String name;

    public int kongge=0;
	
	public int getKongge() {
		return kongge;
	}

	public void setKongge(int kongge) {
		this.kongge = kongge;
	}
//    public Set<Person> personList = new HashSet<Person>();
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public void doSomething() {
		// TODO Auto-generated method stub
		for(int i=0;i<this.getKongge();i++)
			System.out.print("    ");
		System.out.println(name);
		for(Object obj : this.children) {
			
			((ConsistentOrganization)obj).setKongge(getKongge()+2);
			((ConsistentOrganization)obj).doSomething();
		}
		
	}

	@Override
	public ConsistentOrganization addChild(ConsistentOrganization child) {
		// TODO Auto-generated method stub
		this.children.add(child);
		return this;
	}

	@Override	
	ConsistentOrganization deleteChild(ConsistentOrganization child) {
		// TODO Auto-generated method stub
		children.remove(child);
		return this;
	}

	@Override
	Set<ConsistentOrganization> getChildren() {
		// TODO Auto-generated method stub
		return null;
	}

//	@Override
//	Set<ConsistentOrganization> getChildren() {
//		// TODO Auto-generated method stub
//		return null;
//	}
	

}
